package com.github.codemperor.core.message.dingtalk.robot.bean;

import java.util.List;

/**
 * 钉钉机器人父类
 */
public class BaseRobotMsg {
    protected String msgtype;
    /**
     * 是否at所有人，默认否
     */
    protected At at;

    public String getMsgtype() {
        return msgtype;
    }

    public void setMsgtype(String msgtype) {
        this.msgtype = msgtype;
    }

    public At getAt() {
        return at;
    }

    public void setAt(At at) {
        this.at = at;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"msgtype\":\"")
                .append(msgtype).append('\"');
        sb.append(",\"at\":")
                .append(at);
        sb.append('}');
        return sb.toString();
    }

    public static class At {
        /**
         * 是否at所有人，默认否
         */
        private Boolean isAtAll = true;

        private List<String> atMobiles;

        public Boolean getAtAll() {
            return isAtAll;
        }

        public void setAtAll(Boolean atAll) {
            isAtAll = atAll;
        }

        public List<String> getAtMobiles() {
            return atMobiles;
        }

        public void setAtMobiles(List<String> atMobiles) {
            this.atMobiles = atMobiles;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"isAtAll\":")
                    .append(isAtAll);
            sb.append(",\"atMobiles\":")
                    .append(atMobiles);
            sb.append('}');
            return sb.toString();
        }
    }
}
